package com.fxp.project.jiuselu.web.models.userbank.vo;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import lombok.Data;

import java.math.BigDecimal;

public class BankCardInfoVo {

    /**
     * 用户银行卡id
     */
    private Long bankCardId;

    /**
     * 银行卡号
     */
    private String cardNum;

    /**
     * 银行名称
     */
    private String bankName;

    /**
     * 支行名称
     */
    private String banSubBranchName;

    /**
     * 持卡人姓名
     */
    private String cardUserName;

    /**
     * 持卡人身份证号
     */
    private String cardUserIdcard;

    /**
     * 持卡人手机号
     */
    private String cardUserPhone;

    /**
     * 用户id
     */
    private Long userId;

    private BigDecimal userMoney;



    public void setCardNum(String cardNum) {
        if (StringUtils.isNotBlank(cardNum)) {
            cardNum = cardNum.replaceAll("(\\d{4})\\d*(\\d{4})", "$1****$2");
        }
        this.cardNum = cardNum;
    }


    public Long getBankCardId() {
        return bankCardId;
    }

    public void setBankCardId(Long bankCardId) {
        this.bankCardId = bankCardId;
    }

    public String getCardNum() {
        return cardNum;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getBanSubBranchName() {
        return banSubBranchName;
    }

    public void setBanSubBranchName(String banSubBranchName) {
        this.banSubBranchName = banSubBranchName;
    }

    public String getCardUserName() {
        return cardUserName;
    }

    public void setCardUserName(String cardUserName) {
        this.cardUserName = cardUserName;
    }

    public String getCardUserIdcard() {
        return cardUserIdcard;
    }

    public void setCardUserIdcard(String cardUserIdcard) {
        if (StringUtils.isNotBlank(cardUserIdcard)) {
            cardUserIdcard = cardUserIdcard.replaceAll("(\\d{4})\\d*(\\d{4})", "$1****$2");
        }
        this.cardUserIdcard = cardUserIdcard;
    }

    public String getCardUserPhone() {
        return cardUserPhone;
    }

    public void setCardUserPhone(String cardUserPhone) {
        if (StringUtils.isNotBlank(cardUserPhone)) {
            cardUserPhone = cardUserPhone.replaceAll("(\\d{4})\\d*(\\d{4})", "$1****$2");
        }
        this.cardUserPhone = cardUserPhone;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public BigDecimal getUserMoney() {
        return userMoney;
    }

    public void setUserMoney(BigDecimal userMoney) {
        this.userMoney = userMoney;
    }
}
